package com.shop2cn.iapi.sqpayment.testcase;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.sqpayment.parameter.AcquireOrderBean;
import com.shop2cn.iapi.sqpayment.parameter.ExecutePayNotifyBean;
import com.shop2cn.iapi.sqpayment.parameter.PayOrderEnum;
import com.shop2cn.iapi.sqpayment.service.ExecutePayNotifyCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.SQPayGateWayCallService;
import com.ymttest.database.model.AccountEntry;
import com.ymttest.database.model.MPayment;
import com.ymttest.database.sqlwapper.AccountWapper;
import com.ymttest.database.sqlwapper.SQPayGateWayWapper;
import com.ymttest.utils.TestDataManager;
/**
*支付执行通知
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ExecutePayNotify{
	private static ExecutePayNotifyBean executepaynotifyBean;
	private static ExecutePayNotifyCall executepaynotifyCall;
	SQPayGateWayWapper SQPayGateWayWapper;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("支付执行通知");
	}

	@Before
	public void caseUp() {
		executepaynotifyBean=new ExecutePayNotifyBean();
		executepaynotifyCall=new ExecutePayNotifyCall();
		SQPayGateWayWapper=new SQPayGateWayWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(executepaynotifyCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_001() {
		Logger.start(true,"调用执行支付通知paytype10,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	

	@Test
	@Category({P3.class})
	@TestCase
	@Ignore
	//这个case返回ok，不会实际执行
	public void Tc_ExecutePayNotify_002() {
		Logger.start(true,"不存在支付单,失败");
		try {
			executepaynotifyBean.setPaymentId("aaa");
			executepaynotifyCall.setData(executepaynotifyBean);
//			executepaynotifyCall.addHeader("Mock", "1");
//			Logger.comment("设置交易返回MOCK");
//			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
//			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
//			String mockid = TestDataManager.getRandomUUID().toString();
//			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ExecutePayNotify_003() {
		Logger.start(true,"已支付支付单,幂等");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ExecutePayNotify_004() {
		Logger.start(true,"回调状态1无回调地址,更新回调状态2");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setNotifyUrl("");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			SQPayGateWayWapper.updateNotifyStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			MPayment payment = SQPayGateWayWapper.selectPPPaymentByPaymentId(pid).get(0);
			Logger.verifyEquals("2", payment.getNotifyStatus().toString(), "验证返回");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ExecutePayNotify_005() {
		Logger.start(true,"回调状态1有回调地址,通知支付调用方,更新回调状态2");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			SQPayGateWayWapper.updateNotifyStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			MPayment payment = SQPayGateWayWapper.selectPPPaymentByPaymentId(pid).get(0);
			Logger.verifyEquals("2", payment.getNotifyStatus().toString(), "验证返回");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ExecutePayNotify_006() {
		Logger.start(true,"回调状态2,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			SQPayGateWayWapper.updateNotifyStatus(pid, "2");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_007() {
		Logger.start(true,"调用执行支付通知paytype13,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("13");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_008() {
		Logger.start(true,"调用执行支付通知paytype14,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("14");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_009() {
		Logger.start(true,"调用执行支付通知paytype15,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("15");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_010() {
		Logger.start(true,"调用执行支付通知paytype50,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("50");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_011() {
		Logger.start(true,"调用执行支付通知paytype60,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("60");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_012() {
		Logger.start(true,"调用执行支付通知paytype70,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("70");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_013() {
		Logger.start(true,"调用执行支付通知paytype9,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("9");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_014() {
		Logger.start(true,"调用执行支付通知paytype17,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("17");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_015() {
		Logger.start(true,"调用执行支付通知paytype18,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("18");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_016() {
		Logger.start(true,"调用执行支付通知paytype19,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("19");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_017() {
		Logger.start(true,"调用执行支付通知paytype80,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("80");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_018() {
		Logger.start(true,"调用执行支付通知paytype62,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("62");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_019() {
		Logger.start(true,"调用执行支付通知paytype63,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("63");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_020() {
		Logger.start(true,"调用执行支付通知paytype3017,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3017");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_021() {
		Logger.start(true,"调用执行支付通知paytype64,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("64");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_022() {
		Logger.start(true,"调用执行支付通知paytype3013,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3013");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_023() {
		Logger.start(true,"调用执行支付通知paytype3015,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3015");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_024() {
		Logger.start(true,"调用执行支付通知paytype65.HuaweiPay,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("65");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_025() {
		Logger.start(true,"调用执行支付通知paytype66.SamSungPay,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("66");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_026() {
		Logger.start(true,"调用执行支付通知paytype6000.HipoPayWxApp,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6000");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_027() {
		Logger.start(true,"调用执行支付通知paytype8,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("8");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_028() {
		Logger.start(true,"调用执行支付通知paytype6001.HipoPayWxH5执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6001");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_029() {
		Logger.start(true,"调用执行支付通知paytype90,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("90");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_030() {
		Logger.start(true,"调用执行支付通知paytype3113,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3113");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_031() {
		Logger.start(true,"调用执行支付通知paytype3115,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3115");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_032() {
		Logger.start(true,"调用执行支付通知paytype3117,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3117");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_033() {
		Logger.start(true,"调用执行支付通知paytype3213鱼多多,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3213");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_034() {
		Logger.start(true,"调用执行支付通知paytype3215鱼多多,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3215");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_035() {
		Logger.start(true,"调用执行支付通知paytype2013,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("2013");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_036() {
		Logger.start(true,"调用执行支付通知paytype91,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("91");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayWapper.updatePayStatus(pid, "1");
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_037() {
		Logger.start(true,"调用执行支付通知paytype6002HipoPay-微信H5飛界國際電子商務执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6002");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
//			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
//			Logger.debug(mocks);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_038() {
		Logger.start(true,"调用执行支付通知HipoPay-独立商家-执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			aqb.setAppName(SQPayGateWayCallService.PayGdSq.toString());
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
					Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
//					{
//						"appId": "2",
//						"bizCode": "60",
//						"discountAmt": "0.00",
//						"externalPayerId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"externalUserId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"instPaymentId": "1e3efb293b114e36b42c3494404a382",
//						"internalUserId": "30252857",
//						"memo": "",
//						"merchantNo": "WC5c78d78282173",
//						"orderRmb": "2.14",
//						"payChannel": "HipoPay",
//						"payPrice": "2.14",
//						"payTime": "20191114152138",
//						"payType": "6000",
//						"paymentId": "19111415212996810",
//						"settleAmount": "2.14",
//						"settleCurrency": "HKD",
//						"settleRate": "1",
//						"sign": "FDF7A1DC4139BCC4DC89D8DB4CF526F3",
//						"signMethod": "MD5",
//						"traceId": "11562d56-1fc1-4a2c-bcd2-aa72d22e7c69",
//						"tradingId": "1387426562764553",
//						"version": 1
//					},
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyEquals(SQPayGateWayCallService.HipoPayWxAppOpenId, body.get("externalPayerId").toString(), "验证externalPayerId");
					Logger.verifyEquals(SQPayGateWayCallService.HipoPayWxAppOpenId, body.get("externalUserId").toString(), "验证externalPayerId");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(SQPayGateWayCallService.GdDefMerchantNo, body.get("merchantNo").toString(), "验证merchantNo");
					Logger.verifyEquals(aqb.getPayPrice(), body.get("orderRmb").toString(), "验证orderRmb");
					Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(aqb.getPayPrice(), body.get("payPrice").toString(), "验证payPrice");
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(pid, body.get("paymentId").toString(), "验证paymentId");
					Logger.verifyEquals(aqb.getPayPrice(), body.get("settleAmount").toString(), "验证settleAmount");
					Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
					MPayment ppm = SQPayGateWayWapper.selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_039() {
		Logger.start(true,"调用执行支付通知6010盛付通微信小程序-执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6010");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
					Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).setScale(2), new BigDecimal(body.get("payPrice").toString()).setScale(2), "验证payPrice");
					Logger.verifyEquals("ShengPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(pid, body.get("paymentId").toString(), "验证paymentId");
					MPayment ppm = SQPayGateWayWapper.selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_040() {
		Logger.start(true,"调用执行支付通知6011盛付通微信公众号-执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6011");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
					Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).setScale(2), new BigDecimal(body.get("payPrice").toString()).setScale(2), "验证payPrice");
					Logger.verifyEquals("ShengPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(pid, body.get("paymentId").toString(), "验证paymentId");
					MPayment ppm = SQPayGateWayWapper.selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_041() {
		Logger.start(true,"调用执行支付通知6006代购神器HipoPayAliWap,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6006");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_042() {
		Logger.start(true,"调用执行支付通知6100GodAliPayPc,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6100");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_043() {
		Logger.start(true,"调用执行支付通知6103.HipoPay-微信app,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6103");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_044() {
		Logger.start(true,"调用执行支付通知6107.HipoPay-支付宝app,执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6107");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_045() {
		Logger.start(true,"调用执行支付通知paytype6003HipoPay-微信H5飛界國際执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6003");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
//			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
//			Logger.debug(mocks);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_046() {
		Logger.start(true,"调用执行支付通知paytype4013执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("4013");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
//			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
//			Logger.debug(mocks);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_047() {
		Logger.start(true,"调用执行支付通知paytype4016执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("4016");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			SQPayGateWayWapper.updatePayStatus(pid, "1");
			Thread.sleep(1000);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
//			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
//			Logger.debug(mocks);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ExecutePayNotify_048() {
		Logger.start(true,"调用执行支付通知6012盛付通支付宝-执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6012");
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			SQPayGateWayCallService.acquireOrder(aqb);
			String pid = SQPayGateWayCallService.getPaymentId(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			executepaynotifyBean.setPaymentId(pid);
			executepaynotifyCall.setData(executepaynotifyBean);
			executepaynotifyCall.addHeader("Mock", "1");
			Logger.comment("设置交易返回MOCK");
			executepaynotifyCall.addHeader("MockResult-Trading-Status","OK");
			executepaynotifyCall.addHeader("MockResult-Trading-Body",FormatUtil.urlEncode("{\"code\":200}"));
			String mockid = TestDataManager.getRandomUUID().toString();
			executepaynotifyCall.addHeader("MockId", mockid);
			executepaynotifyCall.callService();			
			Logger.verifyEquals("ok", executepaynotifyCall.getReturnData(), "验证返回");
			verifyDB(aqb,pid);
			List<Map> mocks = SQPayGateWayWapper.selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
					Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).setScale(2), new BigDecimal(body.get("payPrice").toString()).setScale(2), "验证payPrice");
					Logger.verifyEquals("ShengPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(pid, body.get("paymentId").toString(), "验证paymentId");
					MPayment ppm = SQPayGateWayWapper.selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	private void verifyDB(AcquireOrderBean aqb,String pid) throws Exception {
		Logger.comment("验证pp_payment");
		MPayment ppm = SQPayGateWayWapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if(ppm.getInstitutionPaymentId()==null){
			Thread.sleep(5000);
			ppm = SQPayGateWayWapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		Logger.comment("验证YmtAccountEntry");
        Map m = new HashMap();
        m.put("bizno", pid);
		 List<com.ymttest.database.model.AccountEntry> actinfos = new AccountWapper().selectAccountEntryByBizNo(m);
		Logger.verifyEquals(1, actinfos.size(), "验证YmtAccountEntry记录条数");
		 AccountEntry actinfo = actinfos.get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())),
				"验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
		}else if (aqb.getBizCode().equals("33")) {
			Logger.verifyEquals("130001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.verifyEquals(30, actinfo.getAccountType(), "验证accountType");
		}
	}
}